home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 16
/
Aminet 16 (1996)(GTI - Schatztruhe)[!][Dec 1996].iso
/
Aminet
/
util
/
rexx
/
CheckArcs.lha
/
CheckArcs.vzrx
Wrap
Text File
|
1996-10-11
|
5KB
|
144 lines
/*
$VER: CheckArc.vzrx 1.02 (10.11.96)
© 1995-96 by Georg Hörmann UPDATED BY ANOME & SH0CKER
Template: CheckArc.vzrx ARC/A,QUIT/S
ARC: The filename (with path) of the archive.
QUIT: If VirusZ has been started from the script, you can
quit after checking by specifying this option.
If VirusZ is not running, it will be started from the
script (and quitted afterwards if requested).
Currently the type of archive is determined by the filename
suffixes ".lha", ".lzh" ".lzx" ".zip" ".dms" and ".exe".
This should usually work properly as nobody ever removes
the suffixes of archive names.
*/
/* Filenames of external programs */
Prog_VirusZ = "SYS:WbStartup/Virusz"
Prog_LHA = "LHA"
Prog_LZX = "UNLZX"
Prog_ZIP = "UNZIP"
Prog_DMS = "UNDMS"
Prog_Delete = "Delete"
TempPath = "RAM:TempArcDir"
options results
options failat 99
UseQuitFlag = "no"
parse upper arg ArcToCheck QuitFlag
if ArcToCheck = "" then do
say "No archive specified."
exit
end
TypeFlag = index(ArcToCheck,.LHA) + index(ArcToCheck,.LZH) + index(ArcToCheck,.LZX) + index(ArcToCheck,.ZIP) + index(ArcToCheck,.DMS) + index(ArcToCheck,.EXE)
if TypeFlag = 0 then do
say "Archive not of required type: " ArcToCheck
exit
end
if ~show(ports,VIRUSZ_II.REXX) then do
say "Starting VirusZ..."
address command Prog_VirusZ
UseQuitFlag = "yes"
StartTime = time(seconds)
do while ~show(ports,VIRUSZ_II.REXX)
if time(seconds) - StartTime > 20 then do
say "Error loading VirusZ!"
exit
end
end
end
if exists(TempPath) then do
/*say "Deleting temporary directory..." */
address command Prog_Delete ">NIL: <NIL:" TempPath ALL FORCE
if rc~=0 then do
say "Error deleting temporary directory!"
signal QuitVirusZ
end
end
TypeFlag = index(ArcToCheck,.LHA) + index(ArcToCheck,.LZH)
if TypeFlag ~= 0 then do
say "Extracting .LHA/.LZH archive... " ArcToCheck
address command Prog_LHA ">NIL: <NIL: -b256 x "ArcToCheck TempPath"/"
if rc~=0 then do
say "***** Error extracting archive!"
signal DeleteTemp
end
end
TypeFlag = index(ArcToCheck,.LZX)
if TypeFlag ~= 0 then do
say "Extracting .LZX archive... " ArcToCheck
address command Prog_LZX ">NIL: <NIL: -bo256 -bi256 x "ArcToCheck TempPath"/"
if rc~=0 then do
say "***** Error extracting archive!"
signal DeleteTemp
end
end
TypeFlag = index(ArcToCheck,.ZIP)
if TypeFlag ~= 0 then do
say "Extracting .ZIP archive... " ArcToCheck
address command Prog_ZIP ">NIL: <NIL: "ArcToCheck "-d" TempPath"/"
if rc~=0 then do
say "***** Error extracting archive!"
signal DeleteTemp
end
end
TypeFlag = index(ArcToCheck,.DMS)
if TypeFlag ~= 0 then do
say "Extracting .DMS archive... " ArcToCheck
address command Prog_DMS ">NIL: <NIL: "ArcToCheck to FF1":"
address VIRUSZ_II.REXX CHECKDIR FF1":" DECREXEC DECRDATA
if rc=0 then say "Archive is clean."
if rc=5 then say "******************************** ->Archive contains
VIRUS(es)!
"
if rc=10 then say "***** Error checking archive!"
end
TypeFlag = index(ArcToCheck,.EXE)
if TypeFlag ~= 0 then do
say "Checking .EXE ... " ArcToCheck
address VIRUSZ_II.REXX CHECKFILE ArcToCheck DECREXEC DECRDATA
if rc=0 then say "File is clean."
if rc=5 then say "******************************* ->File contains
VIRUS(es)!
"
if rc=10 then say "Error checking file!"
end
if exists(TempPath) then do
say "Checking archive contents... " ArcToCheck
address VIRUSZ_II.REXX CHECKDIR TempPath DECREXEC DECRDATA
if rc=0 then say "Archive is clean."
if rc=5 then say "******************************** ->Archive contains
VIRUS(es)!
"
if rc=10 then say "***** Error checking archive!"
end
DeleteTemp:
if exists(TempPath) then do
/*say "Deleting temporary directory..." */
address command Prog_Delete ">NIL: <NIL:" TempPath ALL FORCE
if rc~=0 then do
say "Error deleting temporary directory!"
signal QuitVirusZ
end
end
QuitVirusZ:
if UseQuitFlag = "yes" then do
if QuitFlag = "QUIT" then do
say "Quitting VirusZ..."
address VIRUSZ_II.REXX QUIT
end
end